﻿<!DOCTYPE html>
<html lang="en">

<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <meta http-equiv="X-UA-Compatible" content="ie=edge">
    <title>商城导航</title>
    <link rel="stylesheet" href="../../css/media.css">
    <link rel="stylesheet" href="../../css/base.css">
    <link rel="stylesheet" href="../../css/marketNav.css">
    <link rel="stylesheet" href="../../css/font-style.css">
</head>

<body>
    <!-- 头部 -->
    <header>
        <a href="javascript:;"><span class="icon-arrow_lift back"></span></a>
        <!-- 头部中间文字，看需求 -->
        <h3>商场导航</h3>
        <a href="javascript:;">
            <img src="../../images/header_app.png" alt="">
        </a>
    </header>
    <!-- 商城导航 -->
    <main>
        <nav>
            <div class="marketNav clearfix">

                <!-- <a href="#"><span>88</span><span>99</span></a>
                <a href="#"><span>88</span><span>99</span></a>
                <a href="#"><span>88</span><span>99</span></a>
                <a href="#"><span>88</span><span>99</span></a>
                <a href="#"><span>88</span><span>99</span></a>
                <a href="#"><span>88</span><span>99</span></a>
                <a href="#"><span>88</span><span>99</span></a>
                <a href="#"><span>88</span><span>99</span></a>
                <a href="#"><span>88</span><span>99</span></a> -->
            </div>
        </nav>
    </main>
    <!-- 底部 -->
    <footer>
            <div class="foot_tool">
                <a href="javascript:;">登录</a>
                <a href="javascript:;">注册</a>
                <a href="javascript:;">返回顶部</a>
            </div>
            <div class="foot_content">
                <a href="javascript:;">手机APP下载
                    <span>慢慢买手机版</span>
                </a>
                <span>--掌上比价平台</span>
                <p>m.manmanbuy.com</p>
    
            </div>
        </footer>
</body>
</body>

</html>
<script src="../../lib/zepto/zepto.min.js"></script>
<script src="../../lib/template/template.js"></script>
<script type="text/template" id="navListTmp">
    {{each result as val key}}
        <a href="{{val.navHref}}"><img src="{{val.navImg}}" alt="">{{val.navTitle}}</a>
    {{/each}}
</script>
<script type="text/javascript">
    // <span>{{val.navImg}}</span><span>{{val.title}}</span>
    render();

    function render() {
        $.ajax({
            type: 'get',
            url: 'http://193.112.55.79:9090/api/getsitenav',
            dataType: 'json',
            success: function (res) {
                console.log(res);
                // 准备模板字符串
                var htmlStr = template('navListTmp', res);
                // 动态渲染数据
                $('.marketNav').html(htmlStr);
            }
        })
    };
     //返回上一页
     $('.back').on('click',function(){
        window.history.go(-1);
    });
</script>